// --------------------------------------------------------------------------------------------------------------------
// <copyright file="KinectAgentV2DepthMessage.cs" company="Microsoft Corporation">
// The MIT License (MIT)
// 
// Copyright (c) 2014, Microsoft Corporation
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to deal
//  in the Software without restriction, including without limitation the rights
//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//  copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
namespace Microsoft.Robotics.Vision.Runtime.Cameras
{
    using System.Runtime.Serialization;
    using Microsoft.Robotics.Numerics;
    using Microsoft.Robotics.Runtime;
    using Microsoft.Robotics.Vision.Cameras;

    /// <summary>
    /// Raw Kinect V2 depth frame produced from camera
    /// </summary>
    [DataContract]
    public class KinectAgentV2DepthMessage : KinectV2Properties
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="KinectAgentV2DepthMessage" /> class
        /// </summary>
        /// <param name="originatingTime">The depth image creation time.</param>
        /// <param name="depthFrame">Depth image frame</param>
        /// <param name="minimumDepth">Minimum depth</param>
        /// <param name="maximumDepth">Maximum depth from frame</param>
        /// <param name="noReading">No reading value</param>
        /// <param name="diagonalFov">Diagonal field of view</param>
        /// <param name="horizontalFov">Horizontal field of view</param>
        /// <param name="verticalFov">Vertical field of view</param>
        /// <param name="pose">Current robot-relative pose.</param>
        /// <param name="intrinsicMatrix">Camera intrinsic matrix</param>
        /// <param name="extrinsicMatrix">Camera extrinsic matrix</param>
        public KinectAgentV2DepthMessage(
            long originatingTime,
            ImageFrameDepth depthFrame,
            ushort minimumDepth,
            ushort maximumDepth,
            ushort noReading,
            double diagonalFov,
            double horizontalFov,
            double verticalFov,
            Pose pose,
            Matrix3 intrinsicMatrix,
            Matrix4 extrinsicMatrix)
            : base(originatingTime, diagonalFov, horizontalFov, verticalFov, pose, intrinsicMatrix, extrinsicMatrix)
        {
            this.DepthFrame = depthFrame;
            this.MinimumDepth = minimumDepth;
            this.MaximumDepth = maximumDepth;
            this.NoReading = noReading;
        }

        /// <summary>
        /// Gets the depth image frame
        /// </summary>
        [DataMember]
        public ImageFrameDepth DepthFrame { get; private set; }

        /// <summary>
        /// Gets minimum depth for frame
        /// </summary>
        [DataMember]
        public ushort MinimumDepth { get; private set; }

        /// <summary>
        /// Gets maximum depth for frame
        /// </summary>
        [DataMember]
        public ushort MaximumDepth { get; private set; }

        /// <summary>
        /// Gets no reading value
        /// </summary>
        [DataMember]
        public ushort NoReading { get; private set; }
    }
}
